package
{
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.utils.ByteArray;
	import ResourcePackage.CommonResource;

	public class Message extends VisualObject
	{
		protected var message:String;
		public function Message(s:String, x:int, y:int)
		{
			super(x,y);
			this.message = s;
			this.SetMovieFromByteArray(CommonResource.message.GetByteArray());
		}
		public override function SetMovieFromMovie(m:MovieClip):void
		{
			super.SetMovieFromMovie(m);
			x -= movieClip.Bound.width/2;
			y -= movieClip.Bound.height;
			movieClip.SetText(message);
			movieClip.Play();
		}
		protected override function completeHandler(event:Event):void 
		{
			super.completeHandler(event);
			x -= movieClip.Bound.width/2;
			y -= movieClip.Bound.height;
			movieClip.SetText(message);
			movieClip.Play();
		}
		public override function IsFinish():Boolean
		{
			if(movieClip == null) return false;
			else return movieClip.IsFinish();
		}
	}
}